/**
 * Created by dujiaheng on 2016/8/17.
 */
import * as FStore from './util/FStorage'

var address = FStore.getLocalItem('address')
if (!address) {
    address = '192.168.0.1'
    FStore.setLocalItem('address', address)
}

var port = FStore.getLocalItem('port')
if (!port) {
    port = '8080'
    FStore.setLocalItem('port', port)
}

var serverUrl = function () {
    let address = FStore.getLocalItem('address')
    let port = FStore.getLocalItem('port')
    return 'http://' + address + ':' + port;
};

var mock = function () {
    if (!FStore.getLocalItem('mock')) {
        FStore.setLocalItem('mock', true);
    }
    return FStore.getLocalItem('mock');
}

var unit = {
    server: serverUrl + '/unitUrl',
    mock: 'mock/unit'
}

var home = {
    submit: {
        server: serverUrl + 'submit',
        mock: 'mock/home'
    }
}


export {mock,unit,home,serverUrl}